import 'package:flutter/material.dart';

class MyAppBar extends StatefulWidget implements PreferredSizeWidget{
  final Color color;
  final Widget child;
  MyAppBar({Key key,@required this.child,this.color:const Color(0xFFFFFFFF)}) : assert(child!=null);
  @override
  _MyAppBarState createState() => _MyAppBarState();

  @override
  Size get preferredSize => Size.fromHeight(44.0);
}

class _MyAppBarState extends State<MyAppBar> {
  @override
  Widget build(BuildContext context) {
    return SafeArea(
      top: true,
      child: Container(child: widget.child,color: widget.color,),
    );
  }
}